package com.dps.recommend.metrics;

import com.dps.metrics.mapper.TagMapper;
import com.dps.recommend.beans.DpsRequest;
import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class DpsSenceTagMapper implements TagMapper {
    @Override
    public Map<String, String> mapping(Object... params) {
        Map<String, String> tagMapper = new HashMap<>();
        try {
            DpsRequest dpsRequest = (DpsRequest) params[0];
            String sence = dpsRequest.getRequest().getSence();
            tagMapper.put("sence", StringUtils.isEmpty(sence) ? "" : sence);
        } finally {
            return tagMapper;
        }
    }
}
